<link rel="stylesheet" href="../css/bootstrap.css">
<style>
    form {
        padding: 20px 30px;
    }
    .btn {
        -webkit-border-radius: 4px !important;
        -moz-border-radius: 4px !important;
        border-radius: 4px !important;
        margin: 20px;
    }
</style>
<form action="/admin/student/import" method="post" class="file-form" enctype="multipart/form-data">
    <div class="input-group">
        <input type="file" class="form-control studentExcel-file" name="studentExcel">
    </div>
    <div class="input-group">
        <input type="submit" class="form-control btn btn-primary" value="确认上传">
    </div>
</form>

<script src="../js/jquery-1.8.3.min.js"></script>
<script>
    $(function () {
        $('.file-form').on('submit', function () {
            if (!confirm('确认要上传吗？这个操作会清空原来的所有学生信息，操作需谨慎！')) {
                return false;
            }
            if (!$(".studentExcel-file").val()) {
                alert('请上传你的文件！')
                return false
            }
        })
    })
</script>